<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>更改基数</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<script src="${ctx}/rs/js/jquery.validate.min.js"></script>
<script src="${ctx}/rs/js/jquery.form.js" type="text/javascript"></script>
</head>
<body>
<form id="form1" class="form-horizontal" action="${ctx}/located/Platformsave.htm" method="post" enctype="multipart/form-data">
        <div class="form-group">
            <label for="recipient-name" class="control-label col-sm-2">公众号基数</label>
            <div class="col-sm-10">
            <input type="text" id = "subCountj" name = "subCountj" value ="${subCountj }"/>
            <input type="hidden" id = "areaCode" name= "areaCode" value ="${areaCode }"/>
               
            </div>
        </div>
        
        <div id="divRadioName" class="form-group" >
        <label for="name" class="col-sm-2 control-label item wid1">粉丝基数</label>
        <div class="col-sm-9 wid2" >
            <input type="text" id = "fansCountj" name = "fansCountj" value ="${fansCountj }"/>
        </div>
      </div>
     <div class="form-group">
        <div class="col-sm-10 text-center pt15">
             <button type="button" class="btn btn-primary btn-lg srt-btn active mr30" onclick="valiSubmit()">提交</button>
        </div>
      </div>
</form>


<script type="text/javascript" src="${ctx}/rs/js/bootstrapQ.min.js"></script>
<script src="${ctx}/rs/js/messages_zh.min.js"></script>
<script type="text/javascript">

//初始化验证 start
var form = $('#form1');
form.validate({
    rules: {
    	subCountj: {
    		digits:true,
            required: true,
            min:0
        },
        fansCountj: {
        	digits:true,
            required: true,
            min:0
        }
      },
      highlight: function(element) {
          $(element).closest('.form-group').removeClass('success').addClass('error');
      },
      success: function(element) {
          element.text('OK!').addClass('valid')
          .closest('.form-group').removeClass('error').addClass('success');
      }
});
/** end */



function valiSubmit(){
	if (form.valid()) {
        var data = $("#form1").serialize();      //获取表单多个控件的数据
        $(".unable").show();
        $.ajax({
            url: "${ctx}/located/Platformsave.htm",
            type: "post",
            data: data,
            success: function (text) {
                if(!$('.unable').is(':hidden')){
                    $(".unable").hide();
                }
                // 普通消息提示条
                bootstrapQ.msg({
                    msg : '修改基数成功！',
                    type : 'success',
                    time : 2000
                });
                //触发隐藏确认的按钮，引用回调方法关闭窗口并刷新列表
                $("button.bsok").click();
            }
        });
    } 
}
</script>
</body>
</html>